<template>
  <div class="container">
    <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" />
  </div>
</template>
<script>

export default {
  name: 'Approvals',

  data() {
    return {
      data: [{
        name: '一级 1',
        children: [{
          id: 5,
          name: '二级 1-1'
        }, {
          id: 6,
          name: '二级 1-2'
        }]
      }],
      defaultProps: {
        children: 'id',
        label: 'name'
      }
    }
  },
  created() {
    this.upTree()
  },
  methods: {
    handleNodeClick(data) {
      console.log(1)
    }

  }
}
</script>
